Conditions | 3 |
Total Lines | 21 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import React, { Component, Fragment } from "react" |
||
27 | |||
28 | componentDidMount() { |
||
29 | const $ = require("jquery") |
||
30 | // eslint-disable-next-line |
||
31 | const foundation = require("foundation-sites") |
||
32 | $(document).foundation() |
||
33 | |||
34 | $(".main-nav a").on("click", function () { |
||
35 | if ( |
||
36 | $(this).attr("href").indexOf(window.location.pathname) === 0 && |
||
37 | window.location.hash |
||
38 | ) { |
||
39 | const url = $(this).attr("href") |
||
40 | const hash = url.substring(url.indexOf("#")) |
||
41 | |||
42 | $(`.team-sub_navigation a[href="${hash}"]`).click() |
||
43 | } |
||
44 | }) |
||
45 | |||
46 | if (window.location.hash) { |
||
47 | $(`.team-sub_navigation a[href="${window.location.hash}"]`).click() |
||
48 | } |
||
53 |